package cn.edu.ptu.jobfairs.repository.mapper;


import cn.edu.ptu.jobfairs.repository.IdDao;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * Created by Lin Chenxiao on 2020-03-09
 **/
public interface SqlMapper {
    @SelectKey(statement = "select last_insert_id()", keyProperty = "id.id", before = false, resultType = Integer.class)
    @Insert("${sql}")
    int create(@Param("sql") String sql, @Param("id") IdDao id);
    @Insert("${sql}")
    int insert(@Param("sql") String sql);
    @Delete("${sql}")
    int delete(@Param("sql") String sql);
    @Update("${sql}")
    int update(@Param("sql") String sql);
    @Select("${sql}")
    Long count(@Param("sql") String sql);
    @Select("${sql}")
    Map<String, Object> select(@Param("sql") String sql);
    @Select("${sql}")
    List<Map<String, Object>> multiSelect(@Param("sql") String sql);
}
